package com.aboverock.module.system.mapper;

import java.util.List;
import java.util.Set;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.aboverock.module.system.domain.RoleResource;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Rock Wang
 * @since 2018-05-11
 */
public interface RoleResourceMapper extends BaseMapper<RoleResource> {

    /**
     * 获取指定角色id下的所有资源id.
     *
     * @param roleId the role id
     * @return the list
     */
    public List<String> selectResourceIdsByRoleId(String roleId);

    /**
     * 删除指定资源的所有role-resource关系映射.
     *
     * @param resourceIds the resource ids
     * @return the integer
     */
    public Integer removeByResourceIds(@Param("resourceIds") Set<String> resourceIds);

    /**
     * 删除某个角色与指定资源的role-resource关系映射.
     *
     * @param roleId the role id
     * @param resourceIds the resource ids
     * @return the integer
     */
    public Integer removeByRoleIdAndResourceIds(@Param("roleId") String roleId,
            @Param("resourceIds") List<String> resourceIds);
}
